using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using UnityEngine.UI;
using Yoozoo.UI;

public class ImageBinderTreeItem : BindingBinderTreeItemBase
{
    public static Dictionary<ImageBinder.AttributeType, int> AttributeValueDic =
        new Dictionary<ImageBinder.AttributeType, int>
        {
            {ImageBinder.AttributeType.spriteName, 5},
            {ImageBinder.AttributeType.sprite, 8},
            {ImageBinder.AttributeType.overrideSprite, 8},
            {ImageBinder.AttributeType.preserveAspect, 3},
            {ImageBinder.AttributeType.fillCenter, 3},
            {ImageBinder.AttributeType.fillAmount, 6},
            {ImageBinder.AttributeType.fillClockwise, 3},
            {ImageBinder.AttributeType.fillOrigin, 4},
            {ImageBinder.AttributeType.alphaHitTestMinimumThreshold, 6},
            {ImageBinder.AttributeType.useSpriteMesh, 3},
            {ImageBinder.AttributeType.pixelsPerUnitMultiplier, 6},
            {ImageBinder.AttributeType.onCullStateChanged, 101},
            {ImageBinder.AttributeType.maskable, 3},
            {ImageBinder.AttributeType.isMaskingGraphic, 3},
            {ImageBinder.AttributeType.color, 7},
            {ImageBinder.AttributeType.raycastTarget, 3},
            {ImageBinder.AttributeType.enabled, 3},
        };

    public ImageBinderTreeItem() : base(typeof(Image))
    {
    }

    public override void RebuildTree()
    {
        base.RebuildTree();
        foreach (ImageBinder.AttributeType binderType in Enum.GetValues(typeof(ImageBinder.AttributeType)))
        {
            BindingLinkerTreeItem linkerTreeItem = new BindingLinkerTreeItem(binderType.ToString(),
                binderType.ToString(), AttributeValueDic[binderType]);
            AddChild(linkerTreeItem);
        }
    }
}